Skip to content

Extract syncVersions workflow shell into a script - #97598

Merged
lakchote merged 10 commits into
mainfrom
vit-syncVersions-script
Sep 25, 2026
Merged

lakchote merged 10 commits into
mainfrom
vit-syncVersions-script

Conversation

@mountiny

@mountiny mountiny commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Follow-up to the review feedback on Fix version sync between E/App and Mobile-Expensify: the main shell logic is moved out of .github/workflows/syncVersions.yml and into .github/scripts/syncVersions.sh, leaving the workflow responsible only for workflow_dispatch, checkout, validateActor, setupGitForOSBotify, setupNode, and thin run: invocations.

This is a behavior-preserving refactor. Every annotation string, commit message and git invocation is carried over unchanged.

Six run:-bearing steps collapse into two:

Before After
submoduleRemote, checkVersions ./.github/scripts/syncVersions.sh check
targetVersion, full version sync, submodule-only bump, verifySync ./.github/scripts/syncVersions.sh sync

The script uses two subcommands rather than a single always-run step so that setupNode can stay conditional — it is only needed for the full version sync path, and on macOS it runs npm ci (which also runs npm i inside Mobile-Expensify via scripts/postInstall.sh, dirtying the submodule working tree). Forcing it on the submodule-only path would be both slow and a new failure mode.

Notes on the details that matter for parity:

  • ACTUAL_SHA and NEED_FULL_VERSION_SYNC are threaded from check to sync through step outputs rather than recomputed. Recomputing ACTUAL_SHA would turn the "did the submodule checkout move since we updated it?" guard into a comparison of a value with itself.
  • sync deliberately never re-runs git submodule update --remote — Mobile-Expensify main can advance while Node is being set up between the two steps.
  • The two rebase-retry paths are kept separate rather than factored into a shared helper, because they genuinely differ (the submodule-only path re-updates the submodule, re-stages, and guards with git diff --staged --quiet; the full-sync path does none of that).
  • No ${{ }} expression is interpolated into a shell body any more. TARGET_VERSION and the resolved script path reach the shell via env:, which removes a script-injection vector on a runner that holds OS_BOTIFY_COMMIT_TOKEN and 1Password credentials.
  • The checkout is pinned to ref: main, so moving the logic out of the YAML would have made the script untestable before merge: dispatching from a branch reads this file from the branch but still checks out main's copy of the script, which does not exist yet. A Resolve the script to run step restores that, reading the script from the dispatched ref into $RUNNER_TEMP when it is not main. It goes to a temp file rather than over the working tree, which has to stay clean for the rebase in the push retry path.

The script gains one extra subcommand, version-components, purely so the Android/iOS version math can be unit tested without a repo fixture.

Two follow-ups intentionally left out of this PR so it stays a pure refactor:

  1. The full-sync path runs git add Mobile-Expensify; git commit unconditionally. When the versions differ but the App gitlink already points at Mobile-Expensify main, nothing is staged, git commit exits 1, and the job dies after the local version commit and before any push. The submodule-only path already guards this with git diff --staged --quiet. Fixed in a follow-up PR stacked on this one.
  2. The TARGET_VERSION dispatch input is only usable when it equals the Mobile-Expensify version, since only the App side is rewritten and verification then compares the two. The input description: is clarified here; the behavior is unchanged.

Fixed Issues

$ #88233
PROPOSAL: N/A

Tests

This is a CI-only workflow change; there is no app-facing behavior to exercise. It is covered by new unit tests plus ShellCheck.

  1. Run npm run shellcheck and verify it passes for all files, including the new .github/scripts/syncVersions.sh.

  2. Run the suite on macOS and verify all 16 tests pass. It lives in tests/tooling/, which is where tests for .github/ and scripts/ belong, and runs under bun test rather than Jest:

    TZ=utc bun test --parallel --preload ./scripts/stubReactNative.js --preload ./tests/tooling/setup.ts ./tests/tooling/SyncVersions.test.ts

    It builds throwaway git repos (a bare Mobile-Expensify remote, a bare App remote, and a working clone wiring them together as a submodule) under os.tmpdir() and runs the real script against them:

    • version-components derives the correct SHORT_VERSION / BUILD_NUMBER / CF_VERSION / ANDROID_VERSION_CODE, including zero-padding, matching generateAndroidVersionCode in scripts/bumpVersion.ts.
    • check reports in-sync, full-version-sync-needed, and submodule-bump-needed for the three real-world states.
    • sync in submodule-only mode commits and pushes the new pointer and verifies it, and fails with ::error:: (without pushing) when the submodule checkout moved since check.
    • sync in full-version mode rewrites package.json, android/app/build.gradle and all three Info.plist files, pushes both commits, and fails verification when the target version does not match Mobile-Expensify.
    • Both push rebase retry paths run after an unrelated commit lands on the App remote between check and sync, so the first push is not a fast-forward.
  3. Verify that the four full-version-sync tests are skipped on Linux (they depend on PlistBuddy and BSD sed -i '') and run on macOS. The Bun tests job runs on Ubuntu, so those four would otherwise never run in CI — .github/workflows/testSyncVersions.yml runs the same suite on a macOS runner instead. It is path-gated to .github/scripts/syncVersions.sh and tests/tooling/SyncVersions.test.ts, so it only spends a macOS runner when this script or its tests change. Verify that job is green on this PR and that its log shows all 16 tests running with none skipped.

    • Renaming the test file would stop that job triggering and silently reopen the coverage hole, so the suite's last test asserts the workflow still names this file, in both the paths filter and the run step. It runs on Ubuntu too, via Bun tests.
  4. Confirm the rendered workflow file still contains the same step order: checkout → validateActor → setupGitForOSBotify → check → conditional setupNode → sync → Slack announce → Slack failure.

  5. Deployer validation: trigger the Sync E/App and Mobile-Expensify versions workflow manually from this branch, while App and Mobile-Expensify are already in sync. Verify the Resolve the script to run step logs ::warning::Running syncVersions.sh from vit-syncVersions-script rather than main, and that the run then exits early with ::notice::✅ Versions and submodule are in sync, making no commits, no pushes and no Slack post.

  • Verify that no errors appear in the JS console

Offline tests

Not applicable — this changes a GitHub Actions workflow and its supporting script. There is no client-side behavior and no network state to vary.

QA Steps

Not applicable — no user-facing behavior changes. The workflow is a manual workflow_dispatch restricted to mobile deployers and is validated by triggering it directly (see step 5 in Tests), not on staging or production.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

Not yet tested — needs manual QA.

Android: mWeb Chrome

Not yet tested — needs manual QA.

iOS: Native

Not yet tested — needs manual QA.

iOS: mWeb Safari

Not yet tested — needs manual QA.

MacOS: Chrome / Safari

Not yet tested — needs manual QA.

@mountiny

mountiny commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the manual syncVersions GitHub Actions workflow by extracting its bash logic into a dedicated script, keeping the workflow YAML focused on orchestration (dispatch/checkout/actor validation/git+node setup) while preserving the existing sync behavior and outputs.

Changes:

  • Moved the version/submodule sync logic from .github/workflows/syncVersions.yml into .github/scripts/syncVersions.sh with check, sync, and version-components subcommands.
  • Added a Jest unit test suite that exercises the script against temporary git repo fixtures, including macOS-only coverage for iOS/Android file rewrites.
  • Updated the Jest workflow path filters to run when .sh files change.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/unit/SyncVersionsTest.ts Adds unit/integration-style tests that execute the real script against temp git repos and validate outputs and side effects.
.github/workflows/test.yml Triggers Jest workflow on *.sh changes so script changes run tests in CI.
.github/workflows/syncVersions.yml Replaces inline shell logic with thin invocations of the new script and threads required env/outputs.
.github/scripts/syncVersions.sh Introduces the extracted, subcommand-based bash implementation of the sync workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/scripts/syncVersions.sh Resolved
@MelvinBot

Copy link
Copy Markdown
Contributor

Review — looks solid ✅

This is a faithful, behavior-preserving refactor. I diffed the extracted syncVersions.sh against the deleted inline YAML step-by-step and every annotation string, commit message, git invocation, and sed/PlistBuddy call carries over unchanged. The version-components math also matches generateAndroidVersionCode(version, '10') in scripts/bumpVersion.ts:74 (prefix 10, two digits each for major/minor/patch/build). Nice touches: moving TARGET_VERSION to env: to kill the injection vector, and splitting local decls from command substitutions so set -e still catches failures.

I did not approve (I don't auto-approve), but I found no correctness regressions. One thing worth being aware of before merge:

The full-version-sync path — the riskiest path — isn't covered in CI. The three sync (full version) tests are gated behind describeMacOS because they need PlistBuddy and BSD sed -i '', and the test job runs on Ubuntu — so CI only exercises check, sync (submodule-only), and version-components. The native-file rewriting (build.gradle + three plists) is validated only by running npx jest manually on macOS. You've documented this in the test plan, so this is just a flag, not a request — the automated safety net doesn't reach the most complex branch.

Parity spot-checks & minor notes
  • Conditional simplification is sound. setupNode and the sync step dropped their IN_SYNC != 'true' guards where they became redundant: check sets NEED_FULL_VERSION_SYNC=false whenever IN_SYNC=true, so NEED_FULL_VERSION_SYNC == 'true' already implies IN_SYNC != 'true'. performSync keeps the IN_SYNC != 'true' guard, and verify_sync now runs inside cmd_sync — equivalent to the old standalone verifySync step's condition.
  • Output threading is correct. RECORDED_SHA is now internal to check (no longer an output, and nothing else read it); ACTUAL_SHA flows to sync as EXPECTED_SUBMODULE_SHA, and the submodule-only path still asserts against it.
  • Follow-up Some initial fixes and code style updates #1 is a real latent bug, correctly deferred. In sync_full_version, git add Mobile-Expensify; git commit runs unconditionally, so under set -e an empty stage kills the job — but that's carried over verbatim from the old workflow, so it's not a regression here. Good call stacking the fix.
  • Minor / optional: adding **.sh to the test.yml paths filter means any .sh change in the repo now triggers the full 8-shard jest matrix, not just this script. That's the right tradeoff to get the new test to run, just noting the CI-cost expansion.

All required checks are green.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 3758aefba4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mountiny

mountiny commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — both of your notes are addressed in 34376376b73.

1. The full-version-sync path had no CI coverage. You were right that this was the meaningful gap: the riskiest branch was validated only by running npx jest by hand on a Mac. There's no way around PlistBuddy (absolute path, macOS-only) short of stubbing it, which would just test the stub — so instead the suite now runs on macOS in CI, via a new .github/workflows/testSyncVersions.yml. All 14 tests run there, including the three sync (full version) ones.

It's path-gated to .github/scripts/syncVersions.sh, tests/unit/SyncVersionsTest.ts and the workflow itself, so the macOS runner is only spent when this specific script or its tests change — which is rare.

2. The **.sh path filter expansion. Reverted; test.yml is back to its original paths list, so no other .sh change in the repo triggers the 8-shard matrix. The new macOS workflow is what covers script changes now, and the test file itself is .ts, so it was already matched by **.ts.

I also piped stderr in the fixture's git helper — the setup was dumping every git push to the log, which would have made the new job's output noisy.

On the deferred sync_full_version empty-commit bug you flagged: Copilot raised it too, and it's fixed in the stacked #97599 with a regression test that fails without the guard.

@mountiny

Copy link
Copy Markdown
Contributor Author

@MelvinBot can you sync up with main?

Co-authored-by: Vit Horacek <mountiny@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Synced with main — merged and pushed as 6a16758.

No conflicts. The branch is now 0 commits behind main, and the merge left all four PR files byte-identical:

  • .github/scripts/syncVersions.sh
  • .github/workflows/syncVersions.yml
  • .github/workflows/testSyncVersions.yml
  • tests/unit/SyncVersionsTest.ts

The PR is MERGEABLE; the remaining BLOCKED state is just REVIEW_REQUIRED, not a conflict.


view run

tests/tooling is where tests for .github/ and scripts/ live, and bunTests.yml
already triggers on .github/scripts/**. Jest explicitly ignores that directory.
bun only resolves from node_modules/.bin, which npm run puts on PATH but a
plain run step does not. Every other workflow that calls bun directly uses npx.
@mountiny
mountiny marked this pull request as ready for review September 23, 2026 19:10
@mountiny
mountiny requested a review from a team as a code owner September 23, 2026 19:10
@melvin-bot
melvin-bot Bot requested a review from Eskalifer1 September 23, 2026 19:10
@melvin-bot

melvin-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

@Eskalifer1 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team September 23, 2026 19:10
@mountiny
mountiny removed the request for review from Eskalifer1 September 23, 2026 19:12
@mountiny

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 6218713938

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@MelvinBot

Copy link
Copy Markdown
Contributor

Review — no correctness regressions ✅

Since my last pass at 3758aefb, .github/scripts/syncVersions.sh and .github/workflows/syncVersions.yml are byte-identical — every commit after it is test infrastructure. The CI gap I flagged is genuinely closed: the testSyncVersions job log shows 13 pass / 0 fail, including all three sync (full version) cases, so the plist and build.gradle rewriting is now exercised on a real macOS runner. The **.sh filter expansion is reverted and test.yml paths is back to its original list.

Three things to fix or decide before merge — none of them block the refactor itself.

1. The test plan points at a file that no longer exists

The tests moved to tests/tooling/SyncVersions.test.ts and run under bun test, but the Tests section still says:

Run npx jest tests/unit/SyncVersionsTest.ts on macOS…

and step 3 says "The main Jest job runs on Ubuntu" and "path-gated to … tests/unit/SyncVersionsTest.ts". That command finds nothing now. The real one, from tests/tooling/README.md:

TZ=utc bun test --parallel --preload ./scripts/stubReactNative.js --preload ./tests/tooling/setup.ts ./tests/tooling/SyncVersions.test.ts

The job that skips the three macOS tests on Ubuntu is now Bun tests, not Jest.

2. Both rebase-retry paths are still untested

The if ! git push origin main fallbacks in sync_full_version:182-187 and sync_submodule_only:204-214 are the most intricate code in the script — the submodule-only one re-runs git submodule update --remote, re-stages, and guards with git diff --staged --quiet — and nothing covers them. They were untestable before this PR; now they aren't. Pushing an unrelated commit to the App bare remote between check and sync makes the push non-fast-forward and drives the branch in a few lines of fixture code.

3. The path filter will silently stop running the macOS-only tests

testSyncVersions.yml:10 hardcodes tests/tooling/SyncVersions.test.ts. Rename that file and the macOS job stops triggering, the three full-sync tests skip on Ubuntu, and no test fails — the same coverage hole this PR just closed, reopened invisibly. A glob (tests/tooling/SyncVersions*) or .github/scripts/** removes the trap.

Verification notes
  • Nothing stale in the rewritten workflow. steps.checkVersions and steps.verifySync are gone everywhere; POST_SYNC_APP_VERSION now reads off steps.performSync in the Slack payload. The dropped APP_VERSION / ME_VERSION outputs had no remaining consumers.
  • npx bun is correctly pinned. bun is a devDependency at ^1.3.14 with a 1.3.14 override, so npx resolves node_modules/.bin/bun rather than fetching from the registry — the job log confirms bun test v1.3.14, matching .bun-version. Bare bun only works inside npm run, so npx is the right call here.
  • Duplicate runs are free. bunTests.yml paths already covers .github/scripts/** and tests/tooling/**, so this file also runs on Ubuntu. Under --parallel it's one ~4s worker against a ~53s suite set by CIGitLogic.
  • blacksmith-6vcpu-macos-latest + upstream actions/checkout matches syncVersions.yml, verifyPodfile.yml and verifyParserFiles.yml. Omitting submodules: true is fine — the fixtures build their own throwaway remotes under os.tmpdir(), and postInstall.sh gates the Mobile-Expensify install behind is-hybrid-app.sh.
  • setupNode doesn't disturb the gitlink. postInstall.sh only runs npm i inside the submodule; it never re-runs git submodule update, so check's --remote bump survives into sync. That's what makes the "never re-run --remote" note in the header hold.
  • Sequencing. The empty-commit bug Copilot and I both raised is fixed in [NoQA] Skip the submodule commit during a full version sync when the pointer is already current, which is a draft based on this branch. Merging this first leaves a known job-killing path on main until that lands — worth landing them together or promptly.

I did not approve; I don't auto-approve. The remaining red check is Check independent approval, which needs a human reviewer.


view run

The rebase fallbacks are the most intricate code in the script and nothing
reached them. Pushing an unrelated commit to the App remote between check and
sync makes the first push non fast-forward and drives both.

The macOS job is gated on this file by name, so a rename would stop it
triggering and the full version sync cases would skip on Ubuntu with nothing
failing. The last test asserts the workflow still names this file.
@mountiny

mountiny commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

(Vit's agent)

All three addressed in 837c9da96a5, plus a PR body update.

1. Test plan pointed at a file that no longer exists. Fixed in the body. Step 2 now carries the bun test command from tests/tooling/README.md, step 3 says Bun tests rather than Jest, and both counts are updated to 16.

2. Both rebase-retry paths are now covered. One test per path, each pushing an unrelated commit to the App bare remote between check and sync so the first push is not a fast-forward. Both assert the ::warning::Push failed, attempting rebase... annotation and the resulting commit order on origin/main. I mutation-checked them: stripping both fallbacks down to a bare git push origin main fails exactly these two and nothing else.

3. The path filter trap — fixed differently, and I think better. A glob still breaks on a real rename, so instead the suite's last test asserts that testSyncVersions.yml names this test file in both the paths filter and the run step. That test runs on Ubuntu too, via Bun tests, whose paths already covers tests/tooling/** — so renaming the file fails CI until the workflow is updated, rather than silently skipping. Precedent is tests/tooling/jestPerfCacheKey.test.ts, which asserts cross-workflow consistency the same way. The filter stays an exact path, which keeps the macOS runner spend minimal: tests/tooling changes in 98 commits over the last 90 days, so a directory-wide filter would burn a macOS runner about daily.

One correction to the premise of #3: a rename would not have produced a silent pass at the run step. bun test exits 1 when a filter matches no files (Test filter ... had no matches), so the job would fail if it ran. The real hole was the trigger — the job would not run at all — which is what the new test closes.

On sequencing: agreed, and you're right that #97599 is still a draft. It is MERGEABLE with its checks green, so it only needs marking ready — leaving that to @mountiny, but the two should land together.

@mountiny

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot review

@MelvinBot

Copy link
Copy Markdown
Contributor

Re-review of 837c9da — all three addressed ✅

Verified against CI rather than the description. The testSyncVersions job now reports 16 pass / 0 fail with both new rebase cases green, and the Bun tests job log confirms the workflow-guard test runs on Ubuntu too — so the rename tripwire really does fire in the job that triggers on every tests/tooling/** change.

Your correction on my premise for #3 is right: a rename would have failed the run step, not passed it. The hole was the trigger, and that's what the new test closes.

The rebase tests are the real win. Both drive the fallback through a genuine non-fast-forward push rather than stubbing it, and the assertions pin the thing that actually matters — commit order on origin/main after the replay. The submodule-only case is the sharper of the two: it lands on git diff --staged --quiet being true (the submodule didn't advance again during the race), so the conditional re-commit is correctly skipped and you get exactly two commits, not three. That's the branch that would have been easiest to get wrong.

The guard test's design is better than the glob I suggested. Asserting from inside the file whose rename you're guarding means __filename moves with it and the assertion breaks by construction — a glob would have kept passing. Agreed on keeping the filter an exact path given the macOS runner cost.

One residual gap (non-blocking)

SyncVersions.test.ts:397 guards only the test-file half of the paths filter. The other entry is .github/scripts/syncVersions.sh — the one the macOS job exists to validate.

Moving the script alone fails loudly, since SCRIPT_PATH:14 would no longer resolve and every test would error on spawnSync. But moving it and updating SCRIPT_PATH — the natural way anyone would do it — leaves the workflow filter pointing at a path that no longer exists, and script changes stop triggering the macOS job. Silently, which is the same failure mode you just closed on the other side. One line, reusing the constant that's already there:

expect(workflow.split(path.relative(repoRoot, SCRIPT_PATH))).toHaveLength(2);

(Two, not three — the script path appears only in paths, not in the run step.)

What I checked
  • Test plan is accurate now. Step 2 carries the real bun test invocation, step 3 says Bun tests instead of Jest, and both counts read 16 — matching the job log exactly. "Four full-version-sync tests skipped on Linux" is also right: the new rebase case went into describeMacOS.
  • Full-sync rebase case replays cleanly. Both sync recovery commits land on top of Unrelated change on App main in the asserted order, and UNRELATED.md can't collide with the version files, so the rebase can't conflict and make the test flaky.
  • Script and workflow are still untouched. 837c9da is +66/-0 against one file. .github/scripts/syncVersions.sh and .github/workflows/syncVersions.yml remain byte-identical to what I reviewed at 3758aefb — this is still a behavior-neutral refactor.
  • Sequencing unchanged. [NoQA] Skip the submodule commit during a full version sync when the pointer is already current is still a draft. Worth landing alongside this one.

No further blocking findings from me. I don't auto-approve — the remaining red check is Check independent approval, which needs a human reviewer.


view run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 837c9da96a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…comments

The checkout is pinned to main, so extracting the logic into a script meant a
change to it could not run until it had already landed. Dispatching from a
branch now reads the script from that branch.

The comments carried over from the inline YAML only restated the command
underneath them.
@mountiny
mountiny requested a review from lakchote September 25, 2026 15:12

@lakchote lakchote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tests/tooling/SyncVersions.test.ts Resolved
Comment thread tests/tooling/SyncVersions.test.ts Resolved
mountiny and others added 2 commits September 25, 2026 17:14
Co-authored-by: Lucien Akchoté <lucien@expensify.com>
Co-authored-by: Lucien Akchoté <lucien@expensify.com>

@lakchote lakchote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lakchote
lakchote merged commit 1f588e3 into main Sep 25, 2026
33 of 34 checks passed
@lakchote
lakchote deleted the vit-syncVersions-script branch September 25, 2026 15:34
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.95-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.95-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 failure ❌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants